
package scoreboard;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.ArrayList;
import java.util.List;

import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;



public class ScoreBoard extends JFrame{
	Records data;
	
	
	public void initComponents(){
		this.setLayout(new BorderLayout());
		
		data = new Records();
		data.load();
		JTable table = new JTable(data);
		
		table.setPreferredScrollableViewportSize(new Dimension(400, 100));
        table.setFillsViewportHeight(true);
        JScrollPane scrollpane = new JScrollPane(table);
        scrollpane.setVisible(true);
        this.add(scrollpane, BorderLayout.CENTER);
	}
	

	

	
	public ScoreBoard(){
        super("ScoreBoard");
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        
        setSize(300, 400);
        initComponents();
        pack();
        setVisible(true);
    
	}
}
	
	

